<?php

//var_dump($_POST['param']);
//return $_POST['param'];
function allow_domain(){
 
$is_allow=false;
 
//获取不带端口号的域名前缀
 
$servername=trim($_POST['param']);
 
//授权域名列表
 
$Array=array("localhost","127.0.0.1",'new.com','a.opencart.com');
 
//遍历数组
 
foreach($Array as $value){
 
$value=trim($value);
 
$domain=explode($value,$servername);
 
if(count($domain)>1){
 
$is_allow=true;
 
break;
 
}
 
}
 
if(!$is_allow){
 	echo '该网站未授权！请联系QQ：274340311@qq.com';
	//die("域名未授权！"); //授权失败
 
}else{
 	echo true;
	//echo "域名已授权！"; //授权成功
 
}
 
}
 
allow_domain();
 
?>